<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
var str = '16+5=21';  	//定义一个字符串
var reg = /[\+]/;		//校验含有+号
document.write(reg.test(str));

  </script>
 </body>
</html>
